package com.edu.exam.enums.curriculum.questionbank;

/**
 * 关联强度枚举
 * 
 * 试题分类关联的强度定义
 * 
 * @author System
 * @version 1.0.0
 */
public enum AssociationStrength {
    WEAK("WEAK", "弱关联"),
    MEDIUM("MEDIUM", "中等关联"),
    STRONG("STRONG", "强关联"),
    CRITICAL("CRITICAL", "关键关联");

    private final String code;
    private final String description;

    AssociationStrength(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static AssociationStrength fromCode(String code) {
        for (AssociationStrength strength : values()) {
            if (strength.getCode().equals(code)) {
                return strength;
            }
        }
        return MEDIUM;
    }
}